﻿/**	auto_regist.h
 *	----	Create Time Stamp	--2009-11-08 00:17:08--
 *------------------------------------------------------------------------------
 *	Mean	:
 *	Author	:Nick Shallery	(nicknide@gmail.com)
 *	Version	:1.0.2.2	(2009-11-10 22:26:57)
 *------------------------------------------------------------------------------
**/	/*YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.*/


#if			!defined(__LOLIX__TOY__AUTO__REGIST__H__NICK__K_IN_G__)
#define		__LOLIX__TOY__AUTO__REGIST__H__NICK__K_IN_G__

#if			!defined(__LOLIX__LOLI_X_MACRO__K_IN_G__)
	#include	"../lolix_macro.h"
#endif	//	!defined(__LOLIX__LOLI_X_MACRO__K_IN_G__)

#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
	#include	"../lolix_type.h"
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)

#if			!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)
	#include	"./rebind_type.hpp"
#endif	//	!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)

namespace lolix{namespace toy{
	class auto_regist;
}}


class LOLIX_NO_VTABLE lolix::toy::auto_regist
	: public lolix::itf
{
public:
	LOLIX_DECLARE_ITF(lolix::toy::auto_regist, lolix::itf, (0x2edbdb67, 0xf3e44d49, 0xbf767956, 0x3521a22e));
	LOLIX_DEFINE_FACTORY((0x3b4bb457, 0x09ed43b0, 0xb4ab5543, 0x93141f5e), (auto_regist** out_ptr));
	LOLIX_INTERFACE(regist	, lolix::LOLIX_RETNV	, (lolix::LOLIX_ITF_ID const* id, lolix::itf* i));
	LOLIX_INTERFACE(submit	, lolix::LOLIX_RETNV	, (lolix::lolix_inst* lx_inst));
	LOLIX_INTERFACE(rolloff	, lolix::LOLIX_RETNV	, (lolix::lolix_inst* lx_inst));

	template<typename _Ty>
	LOLIX_INLINE_CALL	LOLIX_RETNV	regist(_Ty* t)
		{
		LOLIX_ITF_ID id;
		LOLIX_ITF_ID_FROM(&id, _Ty);
		return this->regist(&id, t);
		}
};

SYS_REGIST_TYPE(lolix::toy::auto_regist);
SYS_REGIST_TYPE(lolix::toy::auto_regist::factory_type);

#endif	//	!defined(__LOLIX__TOY__AUTO__REGIST__H__NICK__K_IN_G__)
